use crate::key_manager::error::KeyManagerError;
use crate::key_manager::lifecycle::key_observer::observer_init::register::register_observer;
use crate::key_manager::lifecycle::key_observer::KeyLifecycleObserver;
use ctor::ctor;
use sea_orm::DatabaseTransaction;
use std::sync::Arc;
use crate::key_manager::lifecycle::key_observer::key_lifecycle_observer::BoxFuture;

#[derive(Debug)]
pub struct BaselineManager;

unsafe impl Send for BaselineManager{}
unsafe impl Sync for BaselineManager{}

impl KeyLifecycleObserver for BaselineManager {
    fn signature_update(&self, _key_version: &str, _tx: Arc<DatabaseTransaction>) -> BoxFuture<Result<(), Box<KeyManagerError>>> {
        Box::pin(async move {
            Ok(())
        })
    }
}

#[ctor]
fn register_baseline_manager() {
    register_observer(Arc::new(BaselineManager));
}
